<template>
	<view class="wrapper colum">
		<div class="box">
			<u-grid @click="click" class="w100">
				<u-grid-item @click="open('./chazhibi')">
					<u-icon :customStyle="{paddingBottom:10+'rpx'}" name="setting-fill" :size="32"
						color="#000"></u-icon>
					<text class="grid-text">差值比</text>
				</u-grid-item>
				<u-grid-item @click="open('./quansu')">
					<u-icon :customStyle="{paddingBottom:10+'rpx'}" name="chrome-circle-fill" :size="32"
						color="#000"></u-icon>
					<text class="grid-text">圈速</text>
				</u-grid-item>
				<u-grid-item @click="open('./choujiang')">
					<u-icon :customStyle="{paddingBottom:10+'rpx'}" name="info-circle-fill" :size="32"
						color="#000"></u-icon>
					<text class="grid-text">抽奖概率</text>
				</u-grid-item>
			</u-grid>
		</div>
	</view>
</template>

<script>
	import {
		appid
	} from '../../utils/config.js'
	export default {
		data() {
			return {
				loading: true
			}
		},
		computed: {

		},
		onLoad() {
			// #ifdef MP-WEIXIN
			this.login()
			// #endif
			// #ifdef H5
			const r = {
				"session": {
					"sessionKey": "p3Z3ZWe8nhQsgThGBTzcjA==",
					"openid": "o3wW563xE4oMy8Fpb3vW_IEhCilY",
					"unionid": null
				},
				"member": {
					"createBy": "",
					"createTime": "2024-02-06 11:27:55",
					"updateBy": "",
					"updateTime": "2024-02-06 11:27:55",
					"remark": null,
					"id": 1,
					"openId": "o3wW563xE4oMy8Fpb3vW_IEhCilY",
					"nickName": null,
					"headImg": null,
					"mobile": null,
					"gender": null,
					"lastLogin": "2024-02-06"
				}
			}
			uni.setStorageSync('uinfo', r)
			// #endif
		},
		methods: {
			// 微信登陆
			login() {
				let that = this
				uni.login({
					provider: 'weixin',
					success(res) {
						that.$http('/api/member/login', {
							appid,
							code: res.code
						}).then(r => {
							console.log(r)
							uni.setStorageSync('uinfo', r.data)
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.box {
		width: 710rpx;
		padding: 60rpx 0;
	}

	.wrapper {
		height: 80vh;
	}
</style>